
const path = require("path")

function resolve(dir) {
  return path.join(__dirname, dir)
}
const { generateTheme } = require("antd-theme-generator")
// ant-design-vue/dist/antd.less
const options = {
  antDir: path.join(__dirname, "./node_modules/ant-design-vue"), // 对应具体位置
  stylesDir: path.join(__dirname, "./src/styles/theme"), // 对应具体位置
  varFile: path.join(__dirname, "./src/styles/theme/variables.less"), // 对应具体位置
  mainLessFile: path.join(__dirname, "./src/styles/theme/index.less"), // 对应具体位置
  themeVariables: [
    "@primary-color",
  ],
  indexFileName: "index.html",
  outputFilePath: resolve("./public/color.less"),
}
generateTheme(options).then(() => {
  console.log("Theme generated successfully")
}).catch((error) => {
  console.log(error)
  })
